package homework_05.home_02;

import java.util.Scanner;

public class HomeWork_02 {
    /*2.    编写一个方法，判断该年份是平年还是闰年。*/
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入年份：");
        int y=input.nextInt();
        year(y);

    }
    public static void year(int n){
        if (n%4==0&&n%100!=0){
            System.out.println("此年是闰年");
        }
        else if (n%400==0){
            System.out.println("此年是闰年");
        }
        else {
            System.out.println("此年是不闰年");
        }
    }
}
